package org.langqiao.datatype;

public class PrintByte16 {
	
	public static void Hex(byte[] a) {
		
		for(int i = 0;i < a.length;i++) {
			String str = Integer.toHexString(a[i]&0XFF);
			if(str.length() == 1) {
				System.out.print("0"+str+" ");				
			} else {
				System.out.print(str.toUpperCase()+" ");
			}
		}
		System.out.println();//换行
	}
	
	public static void main(String[] args) {
		String q = "2fergruiklikuiuik";
		Hex(q.getBytes());
	}
}
